{include file="common/header"}
<div class="content-wrapper">
    {include file="chat/listsNav"/}
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    {include file="chat/tabs"/}
                    <div class="tab-content">
                        <div class="page-content">
                            <div class="panel panel-info">
                                <div class="panel-heading">
                                    筛选
                                    <span class="pull-right">共有聊天记录&nbsp;<font style="color: red;font-weight: bold;">{$total}</font>&nbsp;条</span>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" method="get" role="form">
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">用户id</label>
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                                                <input type="text" class="form-control" name="uid" value="{$_GET['uid']?$_GET['uid']:''}" placeholder="请输入用户id">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">任务id</label>
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                                                <input type="text" class="form-control" name="task_id" value="{$_GET['task_id']?$_GET['task_id']:''}" placeholder="请输入任务id">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">状态</label>
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                                                <label class="checkbox-inline">
                                                  <select class="form-control select2" name="status" style="width:100%;">
                                                   <option value="" >请选择</option>
                                                <option value="1" {$status==1?'selected':''}>正常</option>
                                                <option value="2" {$status==2?'selected':''}>举报</option>
                                            </select>
                                                </label>
                                              
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12 col-md-offset-2 col-lg-offset-2 col-sm-offset-4">
                                                <button class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <form method="post" class="form-horizontal" id="display_form">
                                <div class="panel panel-default ">
                                    <div class="table-responsive panel-body">
                                        <table class="table table-hover">
                                            <thead class="navbar-inner">
                                            <tr>
                                                <th style="width: 45px">删?</th>
                                                <th>任务ID</th>
                                                <th>任务名称</th>
                                                <th>用户ID</th>
                                                <th>用户昵称</th>
                                                <th>雇主ID</th>
                                                <th>雇主昵称</th>

                                                <th>时间</th>
                                                <th>状态</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            {if !empty($list)}
                                                {volist name="list" id="item"}
                                                <tr>
                                                    <td>
                                                        <input type="checkbox" name="ids[]" value="{$item['id']}">
                                                    </td>
                                                    <td>{$item['task_id']}</td>
                                                    <td>{$item['title']}</td>
                                                    <td>{$item['uid']}</td>
                                                    <td>{$item['user_nickname']}</td>
                                                    <td>
                                                    {$item['sid']}
                                                    </td>
                                             
                                                    <td>{$item['nickname']}</td>
                                              

                                                    <td>
                                                        {$item.create_time}
                                                    </td>
                                                    <td>
                                                        {if $item['status'] == 2}
                                                                 <span style="color:red">   举报
                                                                 </span>
                                                        {else /}
                                                        正常
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        <a href="{:url('chat/index',['cid'=>$item['id']])}" class="btn btn-sm btn-success">查看聊天内容</a>
                                                    </td>
                                                </tr>
                                                {/volist}
                                                <tr>
                                                    <td>
                                                        <input type="checkbox" onclick="var ck = this.checked;$('table').find(':checkbox').each(function(){this.checked = ck});">
                                                    </td>
                                                    <td colspan="6">
                                                        <button class="btn btn-sm btn-danger" name="submit" type="button">删除</button>
                                                    </td>
                                                </tr>
                                            {/if}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </form>
                            {$pager}
                            <script type="text/javascript">
                                $(function () {
                                    $('button[name="submit"]').bind('click',function() {
                                        if (confirm('删除后不可恢复，您确定删除吗？')) {
                                            $.post(
                                                window.location.href,
                                                $('#display_form').serialize(),
                                                function (ret) {
                                                    message(ret.message, ret.redirect, ret.type);
                                                }, 'json'
                                            );
                                        }
                                    });
                                });
                            </script>
                        </div>
                    </div>
                    <!-- /.tab-content -->
                </div>
                <!-- /.nav-tabs-custom -->
            </div>
            <!-- /.col -->
        </div>
    </section>
</div>
{include file='common/ufooter'}
